#include "Animation.h"


Animation::Animation()
{
	amountHorizontalLinearVelocity = 0.1f;
	flytime = 0;
}


Animation::~Animation()
{
}

void Animation::LeftTurn(GameEntity* robot) {
	robot->GetPhysicsNode().SetLinearVelocity(Vector3(amountHorizontalLinearVelocity, 0, 0));
}

void Animation::RightTurn(GameEntity* robot) {
	robot->GetPhysicsNode().SetLinearVelocity(Vector3(-amountHorizontalLinearVelocity, 0, 0));
}
void Animation::Jump(PhysicsNode* robot) {
	robot->SetLinearVelocity(Vector3(0, 2, 0));
}
void Animation::Fly(PhysicsNode* robot){
	robot->SetLinearVelocity(Vector3(0, 1.5, 0));	
}
//void Animation::FlyingTime(PhysicsNode* player,bool isfly){
//	flytime = 0;
//	if (isfly)
//	{
//		Vector3 position = player->GetPosition();
//		if (position.y > terrain->getMaxHeightTerrain()) {
//			position.y = terrain->getMaxHeightTerrain() + 50.0f;
//			physicsNodePlayer->SetPosition(position);
//		}
//		flyTime++;
//		if (flyTime > 600)
//		{
//			physicsNodePlayer->SetUseGravity(true);
//			Isfly = false;
//			flyTime = 0;
//		}
//	}
//}
